/**
 * 
 */
package hu.gbalage.owlforms.xforms.xhtml;

import hu.gbalage.owlforms.xforms.XMLHelper;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * @author balage
 *
 */
public class XHTMLBase {

	public static final String NS_XHTML = "http://www.w3.org/1999/xhtml";
	public static final String NS_EVENT = "http://www.w3.org/2001/xml-events";
	public static final String NS_XFORMS = "http://www.w3.org/2002/xforms";
	
	public static final String NS_RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns";
	public static final String NS_RDFS = "http://www.w3.org/2000/01/rdf-schema";
	public static final String NS_OWL = "http://www.w3.org/2002/07/owl";
	public static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
	
	public final Document doc;
	
	public final Element head;
	
	public final Element body;
	
	public XHTMLBase(String titlestring) {
		doc = XMLHelper.createEmptyDoc();
		
		Element html = doc.createElementNS(NS_XHTML, "html");
		html.setAttribute("xmlns", NS_XHTML);
		html.setAttribute("xmlns:xhtml", NS_XHTML);
		//html.setAttribute("xmlns:rdf", NS_RDF);
		html.setAttribute("xmlns:xf", NS_XFORMS);
		html.setAttribute("xmlns:e", NS_EVENT);
		//html.setAttribute("xmlns:rdfs", NS_RDFS);
		//html.setAttribute("xmlns:owl", NS_OWL);
		//html.setAttribute("xmlns:xsd", NS_XSD);
		doc.appendChild(html);
		
		head = doc.createElement("xhtml:head");
		html.appendChild(head);
		
		Element title = doc.createElement("xhtml:title");
		title.setTextContent(titlestring);
		head.appendChild(title);
		
		/*Element style = doc.createElement("xhtml:link");
		style.setAttribute("rel", "stylesheet");
		style.setAttribute("type", "text/css");
		style.setAttribute("href", "style.css");
		head.appendChild(style);*/
		
		body = doc.createElement("xhtml:body");
		html.appendChild(body);
	}
	
}

